#pragma once
// MESSAGE RESERVE_DEBUG PACKING

#define MAVLINK_MSG_ID_RESERVE_DEBUG 250

MAVPACKED(
typedef struct __mavlink_reserve_debug_t {
 float res1; /*<  res1.*/
 float res2; /*<  res2.*/
 float res3; /*<  res3.*/
 float res4; /*<  res4.*/
 uint32_t res5; /*<  res5.*/
 uint32_t res6; /*<  res6.*/
 int32_t res7; /*<  res7.*/
 int32_t res8; /*<  res8.*/
}) mavlink_reserve_debug_t;

#define MAVLINK_MSG_ID_RESERVE_DEBUG_LEN 32
#define MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN 32
#define MAVLINK_MSG_ID_250_LEN 32
#define MAVLINK_MSG_ID_250_MIN_LEN 32

#define MAVLINK_MSG_ID_RESERVE_DEBUG_CRC 183
#define MAVLINK_MSG_ID_250_CRC 183



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_RESERVE_DEBUG { \
    250, \
    "RESERVE_DEBUG", \
    8, \
    {  { "res1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_reserve_debug_t, res1) }, \
         { "res2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_reserve_debug_t, res2) }, \
         { "res3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_reserve_debug_t, res3) }, \
         { "res4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_reserve_debug_t, res4) }, \
         { "res5", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_reserve_debug_t, res5) }, \
         { "res6", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_reserve_debug_t, res6) }, \
         { "res7", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_reserve_debug_t, res7) }, \
         { "res8", NULL, MAVLINK_TYPE_INT32_T, 0, 28, offsetof(mavlink_reserve_debug_t, res8) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_RESERVE_DEBUG { \
    "RESERVE_DEBUG", \
    8, \
    {  { "res1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_reserve_debug_t, res1) }, \
         { "res2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_reserve_debug_t, res2) }, \
         { "res3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_reserve_debug_t, res3) }, \
         { "res4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_reserve_debug_t, res4) }, \
         { "res5", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_reserve_debug_t, res5) }, \
         { "res6", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_reserve_debug_t, res6) }, \
         { "res7", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_reserve_debug_t, res7) }, \
         { "res8", NULL, MAVLINK_TYPE_INT32_T, 0, 28, offsetof(mavlink_reserve_debug_t, res8) }, \
         } \
}
#endif

/**
 * @brief Pack a reserve_debug message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param res1  res1.
 * @param res2  res2.
 * @param res3  res3.
 * @param res4  res4.
 * @param res5  res5.
 * @param res6  res6.
 * @param res7  res7.
 * @param res8  res8.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_reserve_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               float res1, float res2, float res3, float res4, uint32_t res5, uint32_t res6, int32_t res7, int32_t res8)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_RESERVE_DEBUG_LEN];
    _mav_put_float(buf, 0, res1);
    _mav_put_float(buf, 4, res2);
    _mav_put_float(buf, 8, res3);
    _mav_put_float(buf, 12, res4);
    _mav_put_uint32_t(buf, 16, res5);
    _mav_put_uint32_t(buf, 20, res6);
    _mav_put_int32_t(buf, 24, res7);
    _mav_put_int32_t(buf, 28, res8);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN);
#else
    mavlink_reserve_debug_t packet;
    packet.res1 = res1;
    packet.res2 = res2;
    packet.res3 = res3;
    packet.res4 = res4;
    packet.res5 = res5;
    packet.res6 = res6;
    packet.res7 = res7;
    packet.res8 = res8;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_RESERVE_DEBUG;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_CRC);
}

/**
 * @brief Pack a reserve_debug message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param res1  res1.
 * @param res2  res2.
 * @param res3  res3.
 * @param res4  res4.
 * @param res5  res5.
 * @param res6  res6.
 * @param res7  res7.
 * @param res8  res8.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_reserve_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   float res1,float res2,float res3,float res4,uint32_t res5,uint32_t res6,int32_t res7,int32_t res8)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_RESERVE_DEBUG_LEN];
    _mav_put_float(buf, 0, res1);
    _mav_put_float(buf, 4, res2);
    _mav_put_float(buf, 8, res3);
    _mav_put_float(buf, 12, res4);
    _mav_put_uint32_t(buf, 16, res5);
    _mav_put_uint32_t(buf, 20, res6);
    _mav_put_int32_t(buf, 24, res7);
    _mav_put_int32_t(buf, 28, res8);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN);
#else
    mavlink_reserve_debug_t packet;
    packet.res1 = res1;
    packet.res2 = res2;
    packet.res3 = res3;
    packet.res4 = res4;
    packet.res5 = res5;
    packet.res6 = res6;
    packet.res7 = res7;
    packet.res8 = res8;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_RESERVE_DEBUG;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_CRC);
}

/**
 * @brief Encode a reserve_debug struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param reserve_debug C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_reserve_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_reserve_debug_t* reserve_debug)
{
    return mavlink_msg_reserve_debug_pack(system_id, component_id, msg, reserve_debug->res1, reserve_debug->res2, reserve_debug->res3, reserve_debug->res4, reserve_debug->res5, reserve_debug->res6, reserve_debug->res7, reserve_debug->res8);
}

/**
 * @brief Encode a reserve_debug struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param reserve_debug C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_reserve_debug_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_reserve_debug_t* reserve_debug)
{
    return mavlink_msg_reserve_debug_pack_chan(system_id, component_id, chan, msg, reserve_debug->res1, reserve_debug->res2, reserve_debug->res3, reserve_debug->res4, reserve_debug->res5, reserve_debug->res6, reserve_debug->res7, reserve_debug->res8);
}

/**
 * @brief Send a reserve_debug message
 * @param chan MAVLink channel to send the message
 *
 * @param res1  res1.
 * @param res2  res2.
 * @param res3  res3.
 * @param res4  res4.
 * @param res5  res5.
 * @param res6  res6.
 * @param res7  res7.
 * @param res8  res8.
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_reserve_debug_send(mavlink_channel_t chan, float res1, float res2, float res3, float res4, uint32_t res5, uint32_t res6, int32_t res7, int32_t res8)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_RESERVE_DEBUG_LEN];
    _mav_put_float(buf, 0, res1);
    _mav_put_float(buf, 4, res2);
    _mav_put_float(buf, 8, res3);
    _mav_put_float(buf, 12, res4);
    _mav_put_uint32_t(buf, 16, res5);
    _mav_put_uint32_t(buf, 20, res6);
    _mav_put_int32_t(buf, 24, res7);
    _mav_put_int32_t(buf, 28, res8);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESERVE_DEBUG, buf, MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_CRC);
#else
    mavlink_reserve_debug_t packet;
    packet.res1 = res1;
    packet.res2 = res2;
    packet.res3 = res3;
    packet.res4 = res4;
    packet.res5 = res5;
    packet.res6 = res6;
    packet.res7 = res7;
    packet.res8 = res8;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESERVE_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_CRC);
#endif
}

/**
 * @brief Send a reserve_debug message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_reserve_debug_send_struct(mavlink_channel_t chan, const mavlink_reserve_debug_t* reserve_debug)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_reserve_debug_send(chan, reserve_debug->res1, reserve_debug->res2, reserve_debug->res3, reserve_debug->res4, reserve_debug->res5, reserve_debug->res6, reserve_debug->res7, reserve_debug->res8);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESERVE_DEBUG, (const char *)reserve_debug, MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_CRC);
#endif
}

#if MAVLINK_MSG_ID_RESERVE_DEBUG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_reserve_debug_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  float res1, float res2, float res3, float res4, uint32_t res5, uint32_t res6, int32_t res7, int32_t res8)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_float(buf, 0, res1);
    _mav_put_float(buf, 4, res2);
    _mav_put_float(buf, 8, res3);
    _mav_put_float(buf, 12, res4);
    _mav_put_uint32_t(buf, 16, res5);
    _mav_put_uint32_t(buf, 20, res6);
    _mav_put_int32_t(buf, 24, res7);
    _mav_put_int32_t(buf, 28, res8);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESERVE_DEBUG, buf, MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_CRC);
#else
    mavlink_reserve_debug_t *packet = (mavlink_reserve_debug_t *)msgbuf;
    packet->res1 = res1;
    packet->res2 = res2;
    packet->res3 = res3;
    packet->res4 = res4;
    packet->res5 = res5;
    packet->res6 = res6;
    packet->res7 = res7;
    packet->res8 = res8;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RESERVE_DEBUG, (const char *)packet, MAVLINK_MSG_ID_RESERVE_DEBUG_MIN_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN, MAVLINK_MSG_ID_RESERVE_DEBUG_CRC);
#endif
}
#endif

#endif

// MESSAGE RESERVE_DEBUG UNPACKING


/**
 * @brief Get field res1 from reserve_debug message
 *
 * @return  res1.
 */
static inline float mavlink_msg_reserve_debug_get_res1(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  0);
}

/**
 * @brief Get field res2 from reserve_debug message
 *
 * @return  res2.
 */
static inline float mavlink_msg_reserve_debug_get_res2(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  4);
}

/**
 * @brief Get field res3 from reserve_debug message
 *
 * @return  res3.
 */
static inline float mavlink_msg_reserve_debug_get_res3(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field res4 from reserve_debug message
 *
 * @return  res4.
 */
static inline float mavlink_msg_reserve_debug_get_res4(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field res5 from reserve_debug message
 *
 * @return  res5.
 */
static inline uint32_t mavlink_msg_reserve_debug_get_res5(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  16);
}

/**
 * @brief Get field res6 from reserve_debug message
 *
 * @return  res6.
 */
static inline uint32_t mavlink_msg_reserve_debug_get_res6(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  20);
}

/**
 * @brief Get field res7 from reserve_debug message
 *
 * @return  res7.
 */
static inline int32_t mavlink_msg_reserve_debug_get_res7(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  24);
}

/**
 * @brief Get field res8 from reserve_debug message
 *
 * @return  res8.
 */
static inline int32_t mavlink_msg_reserve_debug_get_res8(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  28);
}

/**
 * @brief Decode a reserve_debug message into a struct
 *
 * @param msg The message to decode
 * @param reserve_debug C-struct to decode the message contents into
 */
static inline void mavlink_msg_reserve_debug_decode(const mavlink_message_t* msg, mavlink_reserve_debug_t* reserve_debug)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    reserve_debug->res1 = mavlink_msg_reserve_debug_get_res1(msg);
    reserve_debug->res2 = mavlink_msg_reserve_debug_get_res2(msg);
    reserve_debug->res3 = mavlink_msg_reserve_debug_get_res3(msg);
    reserve_debug->res4 = mavlink_msg_reserve_debug_get_res4(msg);
    reserve_debug->res5 = mavlink_msg_reserve_debug_get_res5(msg);
    reserve_debug->res6 = mavlink_msg_reserve_debug_get_res6(msg);
    reserve_debug->res7 = mavlink_msg_reserve_debug_get_res7(msg);
    reserve_debug->res8 = mavlink_msg_reserve_debug_get_res8(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_RESERVE_DEBUG_LEN? msg->len : MAVLINK_MSG_ID_RESERVE_DEBUG_LEN;
        memset(reserve_debug, 0, MAVLINK_MSG_ID_RESERVE_DEBUG_LEN);
    memcpy(reserve_debug, _MAV_PAYLOAD(msg), len);
#endif
}
